<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.io.stream.DataStream</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.io.stream.DataStream";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.io.stream.DataStream.html" class="symbol">tango.io.stream.DataStream</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>Initial release: Oct 2007
<p class="sec_header">Author:</p>Kris
<dl>
<dt class="decl">class <a class="symbol _class" name="DataInput" href="./htmlsrc/tango.io.stream.DataStream.html#L35" kind="class" beg="35" end="183">DataInput</a> : InputFilter, Buffered; <a title="Permalink to this symbol" href="#DataInput" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L35">#</a></dt>
<dd class="ddef">
<div class="summary">A simple way to read binary data from an arbitrary InputStream,
        such as a file:
        <pre class="d_code">
<span class="k">auto</span> <span class="i">input</span> = <span class="k">new</span> <span class="i">DataInput</span> (<span class="k">new</span> <span class="i">FileInput</span>(<span class="sl">"path"</span>));
<span class="k">auto</span> <span class="i">x</span> = <span class="i">input</span>.<span class="i">readInt</span>;
<span class="k">auto</span> <span class="i">y</span> = <span class="i">input</span>.<span class="i">readDouble</span>;
<span class="i">input</span>.<span class="i">read</span> (<span class="k">new</span> <span class="k">char</span>[<span class="n">10</span>]);
<span class="i">input</span>.<span class="i">close</span>;
</pre></div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="DataInput.this" href="./htmlsrc/tango.io.stream.DataStream.html#L46" kind="ctor" beg="46" end="50">this</a><span class="params">(InputStream <em>stream</em>, uint <em>buffer</em> = uint.max, bool <em>flip</em> = false)</span>; <a title="Permalink to this symbol" href="#DataInput.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L46">#</a></dt>
<dd class="ddef">
<div class="summary">Propagate ctor to superclass</div></dd>
<dt class="decl">IBuffer <a class="symbol _function" name="DataInput.buffer" href="./htmlsrc/tango.io.stream.DataStream.html#L58" kind="function" beg="58" end="61">buffer</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.buffer" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L58">#</a></dt>
<dd class="ddef">
<div class="summary">Buffered interface</div></dd>
<dt class="decl">DataInput <a class="symbol _function" name="DataInput.clear" href="./htmlsrc/tango.io.stream.DataStream.html#L69" kind="function" beg="69" end="73">clear</a><span class="params">()</span>; <span class="attrs">[<span class="stc">override</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.clear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L69">#</a></dt>
<dd class="ddef">
<div class="summary">Override this to give back a useful chaining reference</div></dd>
<dt class="decl">uint <a class="symbol _function" name="DataInput.get" href="./htmlsrc/tango.io.stream.DataStream.html#L87" kind="function" beg="87" end="94">get</a><span class="params">(void[] <em>dst</em>)</span>; <span class="attrs">[<span class="stc">override</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.get" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L87">#</a></dt>
<dd class="ddef">
<div class="summary">Read an array back into a user-provided workspace. The
                space must be sufficiently large enough to house all of
                the array, and the actual number of bytes is returned.</div>
Note that the size of the array is written as an integer
                prefixing the array content itself.  Use read(void[]) to 
                eschew this prefix.</dd>
<dt class="decl">bool <a class="symbol _function" name="DataInput.getBool" href="./htmlsrc/tango.io.stream.DataStream.html#L100" kind="function" beg="100" end="105">getBool</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.getBool" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L100">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">byte <a class="symbol _function" name="DataInput.getByte" href="./htmlsrc/tango.io.stream.DataStream.html#L111" kind="function" beg="111" end="116">getByte</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.getByte" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L111">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">short <a class="symbol _function" name="DataInput.getShort" href="./htmlsrc/tango.io.stream.DataStream.html#L122" kind="function" beg="122" end="129">getShort</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.getShort" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L122">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">int <a class="symbol _function" name="DataInput.getInt" href="./htmlsrc/tango.io.stream.DataStream.html#L135" kind="function" beg="135" end="142">getInt</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.getInt" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L135">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">long <a class="symbol _function" name="DataInput.getLong" href="./htmlsrc/tango.io.stream.DataStream.html#L148" kind="function" beg="148" end="155">getLong</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.getLong" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L148">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">float <a class="symbol _function" name="DataInput.getFloat" href="./htmlsrc/tango.io.stream.DataStream.html#L161" kind="function" beg="161" end="168">getFloat</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.getFloat" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L161">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">double <a class="symbol _function" name="DataInput.getDouble" href="./htmlsrc/tango.io.stream.DataStream.html#L174" kind="function" beg="174" end="181">getDouble</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataInput.getDouble" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L174">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd></dl></dd>
<dt class="decl">class <a class="symbol _class" name="DataOutput" href="./htmlsrc/tango.io.stream.DataStream.html#L200" kind="class" beg="200" end="316">DataOutput</a> : OutputFilter, Buffered; <a title="Permalink to this symbol" href="#DataOutput" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L200">#</a></dt>
<dd class="ddef">
<div class="summary">A simple way to write binary data to an arbitrary OutputStream,
        such as a file:
        <pre class="d_code">
<span class="k">auto</span> <span class="i">output</span> = <span class="k">new</span> <span class="i">DataOutput</span> (<span class="k">new</span> <span class="i">FileOutput</span>(<span class="sl">"path"</span>));
<span class="i">output</span>.<span class="i">writeInt</span> (<span class="n">1024</span>);
<span class="i">output</span>.<span class="i">writeDouble</span> (<span class="n">3.14159</span>);
<span class="i">output</span>.<span class="i">write</span> (<span class="sl">"hello world"</span>);
<span class="i">output</span>.<span class="i">flush</span>.<span class="i">close</span>;
</pre></div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="DataOutput.this" href="./htmlsrc/tango.io.stream.DataStream.html#L211" kind="ctor" beg="211" end="215">this</a><span class="params">(OutputStream <em>stream</em>, uint <em>buffer</em> = uint.max, bool <em>flip</em> = false)</span>; <a title="Permalink to this symbol" href="#DataOutput.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L211">#</a></dt>
<dd class="ddef">
<div class="summary">Propagate ctor to superclass</div></dd>
<dt class="decl">IBuffer <a class="symbol _function" name="DataOutput.buffer" href="./htmlsrc/tango.io.stream.DataStream.html#L223" kind="function" beg="223" end="226">buffer</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.buffer" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L223">#</a></dt>
<dd class="ddef">
<div class="summary">Buffered interface</div></dd>
<dt class="decl">uint <a class="symbol _function" name="DataOutput.put" href="./htmlsrc/tango.io.stream.DataStream.html#L236" kind="function" beg="236" end="242">put</a><span class="params">(void[] <em>src</em>)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.put" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L236">#</a></dt>
<dd class="ddef">
<div class="summary">Write an array to the target stream. Note that the size 
                of the array is written as an integer prefixing the array 
                content itself. Use write(void[]) to eschew this prefix.</div></dd>
<dt class="decl">void <a class="symbol _function" name="DataOutput.putBool" href="./htmlsrc/tango.io.stream.DataStream.html#L248" kind="function" beg="248" end="251">putBool</a><span class="params">(bool <em>x</em>)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.putBool" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L248">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">void <a class="symbol _function" name="DataOutput.putByte" href="./htmlsrc/tango.io.stream.DataStream.html#L257" kind="function" beg="257" end="260">putByte</a><span class="params">(byte <em>x</em>)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.putByte" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L257">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">void <a class="symbol _function" name="DataOutput.putShort" href="./htmlsrc/tango.io.stream.DataStream.html#L266" kind="function" beg="266" end="271">putShort</a><span class="params">(short <em>x</em>)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.putShort" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L266">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">void <a class="symbol _function" name="DataOutput.putInt" href="./htmlsrc/tango.io.stream.DataStream.html#L277" kind="function" beg="277" end="282">putInt</a><span class="params">(int <em>x</em>)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.putInt" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L277">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">void <a class="symbol _function" name="DataOutput.putLong" href="./htmlsrc/tango.io.stream.DataStream.html#L288" kind="function" beg="288" end="293">putLong</a><span class="params">(long <em>x</em>)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.putLong" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L288">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">void <a class="symbol _function" name="DataOutput.putFloat" href="./htmlsrc/tango.io.stream.DataStream.html#L299" kind="function" beg="299" end="304">putFloat</a><span class="params">(float <em>x</em>)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.putFloat" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L299">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd>
<dt class="decl">void <a class="symbol _function" name="DataOutput.putDouble" href="./htmlsrc/tango.io.stream.DataStream.html#L310" kind="function" beg="310" end="315">putDouble</a><span class="params">(double <em>x</em>)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DataOutput.putDouble" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DataStream.html#L310">#</a></dt>
<dd class="ddef">
<div class="summary"></div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) 2007 Kris Bell. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:01 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>